package com.example.sfm.pojo.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Range;
import org.hibernate.validator.constraints.URL;

@Data
@Accessors(chain = true)
@Schema(description = "用户更新传输对象")
public
class UserUpdateDto {
    @Schema(description = "真实姓名")
    @Size(max = 50)
    private String fullName;

    @Schema(description = "邮箱")
    @Email
    private String email;

    @Schema(description = "手机号")
    @Pattern(regexp = "^1[3-9]\\d{9}$")
    private String phone;

    @Schema(description = "头像URL")
    @URL
    private String avatar;

    @Schema(description = "角色（0=管理员,1=教师,2=学生）")
    @Range(min = 0, max = 2)
    private Integer role;

    private String username;
}
